var __extends =
    (this && this.__extends) ||
    (function () {
      var r = function (t, o) {
        return (r =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (r, t) {
              r.__proto__ = t;
            }) ||
          function (r, t) {
            for (var o in t)
              Object.prototype.hasOwnProperty.call(t, o) && (r[o] = t[o]);
          })(t, o);
      };
      return function (t, o) {
        function e() {
          this.constructor = t;
        }
        if ("function" != typeof o && null !== o)
          throw new TypeError(
            "Class extends value " + String(o) + " is not a constructor or null"
          );
        r(t, o),
          (t.prototype =
            null === o
              ? Object.create(o)
              : ((e.prototype = o.prototype), new e()));
      };
    })(),
  AXProgressBarView = (function (r) {
    function t() {
      var t = r.call(this) || this;
      return (
        (t.waiting = !0),
        (Laya.loader.retryNum = 2),
        (t.closeEffect = null),
        t.label_cancel.on(Laya.Event.CLICK, t, t.cancelFn),
        t
      );
    }
    return (
      __extends(t, r),
      (t.showProgressView = function () {
        null == this.progressBarV && (this.progressBarV = new t()),
          this.progressBarV.isPopup ||
            ((this.progressBarV.waiting = !0),
            this.progressBarV.popup(!0, !1),
            (this.progressBarV.label_cancel.visible = !1),
            Laya.timer.once(
              4e4,
              this.progressBarV,
              this.progressBarV.showCancel
            ));
      }),
      (t.prototype.onCloseAnimation = function () {}),
      (t.onLoadedRecourse = function (r) {
        this.showProgressView(),
          (this.progressBarV.progress_bar.value = r),
          (this.progressBarV.label_percent.text = Math.floor(100 * r) + "/100"),
          1 == r &&
            ((this.progressBarV.waiting = !1),
            this.progressBarV.close("OK"),
            Laya.timer.clear(this.progressBarV, this.progressBarV.showCancel));
      }),
      (t.prototype.showCancel = function () {
        (this.waiting = !1), (this.label_cancel.visible = !0);
      }),
      (t.prototype.cancelFn = function () {
        this.close("CANCEL"), Browser.window.location.reload();
      }),
      (t.prototype.close = function (t) {
        ("side" == t && this.waiting) || r.prototype.close.call(this, t);
      }),
      t
    );
  })(ui.common.AXProgressBarViewUI);
